/*
 *  YATUN  - Yet another tunneling application
 *
 *  Michal Demin - 2007
 *
 *  IO_TCP.h
 *
 */

#ifndef IO_TCP_h
#define IO_TCP_h

#include "Yatun.h"
#include "c_Plug_IO.h"


class IO_TCP : public c_Plug_IO {
    private:
	int socket_fd;
	int fd;
	int server;
	int listen_on;
	struct sockaddr_in localaddr;
	struct sockaddr_in remoteaddr;
	
    public:
	IO_TCP();
	IO_TCP(struct sockaddr_in *);
	virtual ~IO_TCP();
	
	void SetAddress(struct sockaddr_in *);
	struct sockaddr_in *GetRemoteAddr();
	
	int Listen();
	
	virtual int Open();
	virtual int Close();
	virtual int Connect();
	virtual int Recieve(Packet *);
	virtual int Send(Packet *);
	virtual int DataReady();
	virtual int GetFD();
};

#endif
